sqlplus /nolog <<EOF
connect / as sysdba
startup nomount pfile=${ORACLE_BASE}/admin/${ORACLE_SID}/pfile/init${ORACLE_SID}.ora

create database ${ORACLE_SID}
user sys identified by sys
user system identified by system
logfile group 1 ('${ORACLE_BASE}/oradata/${ORACLE_SID}/redo01.log') size 10M,
group 2 ('${ORACLE_BASE}/oradata/${ORACLE_SID}/redo02.log') size 10M,
group 3 ('${ORACLE_BASE}/oradata/${ORACLE_SID}/redo03.log') size 10M
maxlogfiles 5
maxlogmembers 5
maxloghistory 1
maxdatafiles 254 
maxinstances 1
archivelog
character set ZHS32GB18030
national character set AL16UTF16
datafile '${ORACLE_BASE}/oradata/${ORACLE_SID}/system01.dbf' size 300M
default temporary tablespace tbstemp tempfile '${ORACLE_BASE}/oradata/${ORACLE_SID}/temp01.dbf' size 500M
undo tablespace tbsundo datafile '${ORACLE_BASE}/oradata/${ORACLE_SID}/undo01.dbf' size 500M;

connect sys/sys as sysdba
@${ORACLE_HOME}/rdbms/admin/catalog.sql
@${ORACLE_HOME}/rdbms/admin/catproc.sql
create spfile from pfile='${ORACLE_BASE}/admin/${ORACLE_SID}/pfile/init${ORACLE_SID}.ora';

connect system/system
@${ORACLE_HOME}/sqlplus/admin/pupbld.sql

exit
EOF
